package seven.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import seven.service.UserService;
import seven.service.UserServiceImpl;
import seven.servlet.UserServlet;

//这个地方是要用配置文件进行配置的
@Configuration
public class SpringConfiguration_2 {
    @Bean
    public UserService userService(){
        UserService userService=new UserServiceImpl();

        return userService;
    }

    //如果想传参
//    @Bean
//    public UserServlet userServlet(UserService userService){
//        UserServlet userServlet=new UserServlet();
//        userServlet.userService2=userService;
//        System.out.println("2=============>"+userService);
//        return userServlet;
//    }
}
